<template>
	<view class="personage">
		<view class="title">
			<view v-if="true" class="top">置顶</view>
		</view>
		<view class="header">
			<image class="image" src="../static/logo.png"></image>
			<view class="message">
				<view class="message-people">
					<view class="name">
						{{people.name}}
					</view>
					<view v-if="people.sex" class="sex">{{people.sex}}</view>
					<view v-if="people.age" class="age">{{people.age}}岁</view>
					<view v-if="true" class="btn-top" @click.stop="top(people.id)">我要置顶</view>
				</view>
				<view v-if="people.label" class="label">
					<view v-for="(item,index) in people.label" :key="index">
						<view class="label-index">{{item}}</view>
					</view>
				</view>
				<view v-else class="job-message">
					<view class="people">
						<view class="nation">{{people.nation}}</view>
						<view class="seniority">{{people.seniority}}</view>
					</view>
					<view class="nature">
						{{people.nature}}
					</view>
				</view>
			</view>
		</view>
		<view class="type-job">
			<view class="label">
				<view v-for="(item,index) in people.typeJob" :key="index+'1'">
					<view class="label-job">{{item}}</view>
				</view>
			</view>
			<view class="content">
				{{people.text}}
			</view>
		</view>
		<view class="map">
			<view class="address">
				<image src="../static/address.jpg"></image>
				{{people.address}}
			</view>
			<view v-if="people.profession" class="profession">{{people.profession}}</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		props: {
			people: {
				type: Object,
				default: () => {}
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	.personage {
		background: #FFFFFF;
		margin-bottom: 20rpx;
		overflow: hidden;
		.title {
			display: flex;
			justify-content: space-between;
			position: relative;
			padding-bottom: 14rpx;
			padding-left: 30rpx;
			font-size: 40rpx;
			font-weight: bold;

			.top {
				width: 140rpx;
				position: absolute;
				top: 28rpx;
				left: -32rpx;
				text-align: center;
				padding: 0 20rpx;
				background: #ff0000;
				color: #FFFFFF;
				font-size: 32rpx;
				-moz-transform: rotate(-45deg);
				-webkit-transform: rotate(-45deg);
				-o-transform: rotate(-45deg);
				-ms-transform: rotate(-45deg);
				transform: rotate(-45deg);
			}

			.concent {
				width: 450rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
			}
		}

		.header {
			display: flex;
			padding: 20rpx 40rpx;

			.image {
				width: 140rpx;
				height: 140rpx;
				margin-right: 30rpx;
				border-radius: 999rpx;
			}

			.message {
				display: flex;
				flex-direction: column;

				.message-people {
					display: flex;
					margin-bottom: 20rpx;
					position: relative;
					.btn-top {
						width: 150rpx;
						border: solid 1px #0497ff;
						padding: 6rpx;
						border-radius: 6rpx;
						background: #e2e2e2;
						color: #0497ff;
						font-size: 30rpx;
						text-align: center;
						position: absolute;
						right: 0;
					}

					.name,
					.sex {
						font-size: 36rpx;
						margin-right: 20rpx;
					}

					.age {
						color: #F56723;
						font-size: 36rpx;
					}
				}

				.label {
					display: flex;
					width: 500rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;

					.label-index {
						white-space: nowrap;
						border: solid 1px #007AFF;
						border-radius: 10rpx;
						color: #007AFF;
						font-size: 34rpx;
						padding: 0 12rpx;
						margin-right: 20rpx;
						margin-top: 20rpx;
					}
				}

				.job-message {
					display: flex;
					position: relative;

					.people {
						display: flex;

						.nation,
						.seniority {
							color: #808080;
							margin-right: 20rpx;
							font-size: 34rpx;
						}
					}

					.nature {
						position: absolute;
						right: -180rpx;
						color: #000000;
						font-size: 38rpx;
					}
				}

			}
		}

		.type-job {
			display: flex;
			flex-direction: column;
			padding: 20rpx 0;
			margin: 0 40rpx;
			border-bottom: solid 1px #808080;

			.label {
				display: flex;
				flex-direction: column;
				margin-bottom: 20rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;

				.label-job {
					display: inline;
					background: #DCDEE0;
					color: #808080;
					font-size: 34rpx;
					padding: 0 14rpx;
				}
			}

			.content {
				color: #808080;
				margin-bottom: 12rpx;
				font-size: 34rpx;

			}
		}

		.map {
			display: flex;
			justify-content: space-between;
			padding: 20rpx 40rpx;

			.address {
				display: flex;
				align-items: center;
				font-size: 34rpx;
				color: #808080;

				image {
					width: 42rpx;
					height: 42rpx;
					margin-right: 20rpx;
				}
			}

			.profession {
				color: #808080;
				font-size: 34rpx;
			}
		}
	}
</style>
